package de.medizin.uni.halle.irm;

import java.util.List;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import com.actionbarsherlock.app.SherlockFragment;

class PagerAdapter extends FragmentStatePagerAdapter { 
	private List<SherlockFragment> fragments;
	   
    public PagerAdapter(FragmentManager fragmentManager, List<SherlockFragment> fragments) {  
         super(fragmentManager);  
         this.fragments = fragments;
    }  

    @Override  
    public SherlockFragment getItem(int index) {  
    	return this.fragments.get(index);
    }  

    @Override  
    public int getCount() {  
    	return this.fragments.size(); 
    }
    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }
    
    public SherlockFragment CurrentObject;

    @Override
    public void setPrimaryItem(ViewGroup container, int position, Object object) {
    	CurrentObject = (SherlockFragment)object;
    }

}  